package com.monlyu.action.devicesupply;

import com.monlyu.action.PageAction;
import com.monlyu.bean.Pages;
import com.monlyu.bo.DeviceSupplyBo;
import com.monlyu.vo.DeviceSupply;

/**
 * @author SongJun
 * @since 2010-3-7
 * @description
 */
public class ListDeviceSupplyAction extends PageAction {
	private DeviceSupplyBo deviceSupplyBo;
	private Pages<DeviceSupply> ds;
	private Long dsid;

	public Long getDsid() {
		return dsid;
	}

	public void setDsid(Long dsid) {
		this.dsid = dsid;
	}

	public Pages<DeviceSupply> getDs() {
		return ds;
	}

	public void setDs(Pages<DeviceSupply> ds) {
		this.ds = ds;
	}

	public void setDeviceSupplyBo(DeviceSupplyBo deviceSupplyBo) {
		this.deviceSupplyBo = deviceSupplyBo;
	}

	@Override
	public String execute() throws Exception {
		ds = deviceSupplyBo.getDeviceSupply(getDefPage());
		return view("listdevicesupply.jsp");
	}

	public String toEnable() {
		deviceSupplyBo.toEnable(dsid, true);
		ds = deviceSupplyBo.getDeviceSupply(getDefPage());
		return view("listdevicesupply.jsp");
	}

	public String toDisable() {
		deviceSupplyBo.toEnable(dsid, false);
		ds = deviceSupplyBo.getDeviceSupply(getDefPage());
		return view("listdevicesupply.jsp");
	}

}
